/* JavaLog - package tracker 
 * 
 * Copyright (C) 2009  Allyson Lima, Diego Pedro, Victor Freire
 * 
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software 
 * Foundation, either version 3 of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with this 
 * program.  If not, see <http://www.gnu.org/licenses/>.
 */


package br.edu.ufcg.ccc.javalog.model;

import br.edu.ufcg.ccc.javalog.Address;
import br.edu.ufcg.ccc.javalog.Headquarters;

/**
 * Class for retrieving model objects.
 * @author Allyson Lima, Diego Pedro, Victor Freire
 * @version 11/10/09
 */
public class Data {
	private static Headquarters headquarters;
	
	/**
	 * Return headquarters model.
	 */
	public static Headquarters getHeadquarters() {
		if(headquarters == null) init();
		return headquarters;
	}
	
	/**
	 * Initialize data.
	 */
	public static void init() {
		// Create default HQ
		try {
			headquarters = new Headquarters("Matriz", new Address("Nordeste", "Paraiba", "Campina Grande", 
			    "Bodocongo", "59021-666", "Aprigio Veloso", "666"), true);
		} catch(Exception ex) {
			System.err.println("Should not have thrown an exception");
			ex.printStackTrace();
			System.exit(1);
		}
	}
}
